package com.tangding.log.impl;

import org.springframework.stereotype.Component;

import com.google.common.base.Strings;
import com.tangding.common.utils.JacksonUtil;
import com.tangding.log.LogMatcher;

/**
 * @description 
 *
 * @author Ranger
 * @version 2017年12月1日_下午8:48:58
 *
 */
@Component
public class UpdateRoleLog extends LogMatcher {
	
	@Override
	public String cmdDisplay(String cmd, Object... args) {
		Object[] as = (Object[])(args[0]);
		String newName = JacksonUtil.get(as[0], "newName", true);
		String roleName = JacksonUtil.get(as[0], "cid.selectItem.info", true);
		if (!Strings.isNullOrEmpty(newName) && !newName.equals(roleName)) {//改了新名字
			return "修改【" + roleName + "】名称为【" + newName + "】";
		}
		return "修改【" + roleName + "】";
	}
	
}
